/*
	YoghurtGum - 2D Game Engine

	Copyright 2009-2011 Quinten Lansu
	
	Licensed under the Apache License, Version 2.0 (the "License"); you may not 
	use this file except in compliance with the License. You may obtain a copy 
	of the License at 
		
		http://www.apache.org/licenses/LICENSE-2.0 
		
	Unless required by applicable law or agreed to in writing, software 
	distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
	License for the specific language governing permissions and limitations 
	under the License. 
*/

#ifndef _YGERROR_H_
#define _YGERROR_H_

#include "YGSettings.h"
#include "YGSources.h"
#include "YGLog.h"

#if (YG_OS_TYPE == YG_OS_TYPE_WINDOWSMOBILE)

	#include "WM6\YGErrorDefWM6.h"

#elif (YG_OS_TYPE == YG_OS_TYPE_BADA)

	#include "Bada\YGErrorDefBada.h"

#elif (YG_OS_TYPE == YG_OS_TYPE_BADA)

	#include "Android\YGErrorDefAndroid.h"

#endif

namespace YoghurtGum
{

	struct Error
	{

		enum Severity
		{
			ERROR_FATAL,
			ERROR_NORMAL
		};

		static void Explain(const char* a_Explanation, int a_Line = -1, char* a_File = "", Severity a_Fatality = ERROR_NORMAL, ...);

		static char* GetLastExplanation();

#if (YG_OS_TYPE == YG_OS_TYPE_WINDOWSMOBILE)

		static bool BaseCheck(Flag a_Flag);

		static bool Failed(Flag a_Status);

		static bool LastError();

		static void DefaultError(Flag a_Flag);

#endif

		static bool s_FatalError;
		static char s_Explanation[512];
	
	}; // struct Error

}; // namespace YoghurtGum

#endif
